import { http } from "@/utils/http";

export interface QueryUserAccountDetail {
  userId: number;
}

export interface UserDetailVO {
  id: number;
  nickName: string;
  signature: string;
  gender: number;
  birthday: string;
  nativePlace: string;
  location: string;
  isMobileVerify: number;
  headImg: string;
  backgroundImg: string;
  userType: number;
  status: number;
  isReal: number;
  source: number;
  career: number;
  travelObjective: string;
  promotion: string;
  interestList: string;
  mbit: string;
  holidayType: number;
  holidayTypeDesc: string;
  travelPlanType: number;
  travelPlanTypeDesc: string;
  createTime: string;
  updateTime: string;
}

export interface QueryUserAccountByCondition extends BizPageReq {
  userId: number;
  userName: string;
  location: string;
  status: number;
}

export interface UserBaseVO {
  id: number;
  nickName: string;
  userName: string;
  gender: number;
  birthday: string;
  nativePlace: string;
  location: string;
  mobile: string;
  headImg: string;
  userType: number;
  status: number;
  isReal: number;
  source: number;
  registerDay: string;
}

export interface MutedUserAccount {
  userId: number;
  status: number;
  reason: string;
}

export interface QueryUserOperateRecordByCondition extends BizPageReq {
  userId: number;
  mobile: string;
}

export interface UserOperateRecordVO {
  id: number;
  userId: number;
  operateType: number;
  originInfo: string;
  afterInfo: string;
  operateResult: number;
  operateInfo: string;
}

export interface QueryUserAuthRecordList {
  userId: number;
  mobile: string;
}

export interface UserAuthVO {
  id: number;
  userId: number;
  platformChannelKey: string;
  platformKey: number;
  unionId: string;
  openId: string;
  authParseResult: string;
}

//查询用户详情
export const queryUserAccountDetailApi = (data: QueryUserAccountDetail) => {
  return http.request<BizResponse<UserDetailVO>>(
    "post",
    "/user/queryUserAccountDetail",
    {
      data
    }
  );
};

//多条件查询用户信息
export const queryUserAccountByConditionApi = (
  data: QueryUserAccountByCondition
) => {
  return http.request<BizResponse<BizPageResult<UserBaseVO>>>(
    "post",
    "/user/queryUserAccountByCondition",
    {
      data
    }
  );
};

//禁言用户
export const mutedUserAccountApi = (data: MutedUserAccount) => {
  return http.request<BizResponse<UserDetailVO>>(
    "post",
    "/user/mutedUserAccount",
    {
      data
    }
  );
};

//多条件查询用户操作记录
export const queryUserOperateRecordByConditionApi = (
  data: QueryUserOperateRecordByCondition
) => {
  return http.request<BizResponse<BizPageResult<UserOperateRecordVO>>>(
    "post",
    "/user/queryUserOperateRecordByCondition",
    {
      data
    }
  );
};

//查询用户三方授信记录列表
export const queryUserAuthRecordListApi = (data: QueryUserAuthRecordList) => {
  return http.request<BizResponse<Array<UserAuthVO>>>(
    "post",
    "/user/queryUserAuthRecordList",
    {
      data
    }
  );
};
